package com.ihg.hiex.admin.entity.dto;

/**
 * 
 * @author mohanlan
 *
 */
public class OwnerRelations {
	
	private String assessorEvalution;
    
    private String internalBenchmark;
    
    private String externalBenchmark;
    
    private int ljtr;
    
    private int zqfk;
    
    private int yrhd;
    
    private int sftr;
    
    private int tdhz;
    
    private int tzgd;
    
    private int csbz;
    
    private int jjct;
    
    private int potential;
	
    /**
     * The default constructor
     */
    public OwnerRelations() {
    	
	}
    
    /**
     * 
     * @param ljtr
     * @param zqfk
     * @param yrhd
     * @param sftr
     * @param tdhz
     * @param tzgd
     * @param csbz
     * @param jjct
     */
    public OwnerRelations(int ljtr, int zqfk, int yrhd, int sftr, int tdhz, int tzgd, int csbz, int jjct) {
    	this.ljtr = ljtr;
    	this.zqfk = zqfk;
    	this.yrhd = yrhd;
    	this.sftr = sftr;
    	this.tdhz = tdhz;
    	this.tzgd = tzgd;
    	this.csbz = csbz;
    	this.jjct = jjct;
    	
    	double po = (ljtr + zqfk + yrhd + tdhz + tzgd + csbz + jjct) * 0.111111 + (sftr) * 0.222222;
    	
    	if(po > new Double(6.88)) {
    		this.potential = new Integer(10);
    	} else if (po > new Double(6.50)) {
    		this.potential = new Integer(9);
    	} else if (po > new Double(6.25)) {
    		this.potential = new Integer(8);
    	} else if (po > new Double(5.88)) {
    		this.potential = new Integer(7);
    	} else if (po > new Double(5.50)) {
    		this.potential = new Integer(6);
    	} else if (po > new Double(5.13)) {
    		this.potential = new Integer(5);
    	} else if (po > new Double(4.75)) {
    		this.potential = new Integer(4);
    	} else if (po > new Double(4.50)) {
    		this.potential = new Integer(3);
    	} else if (po > new Double(4.13)) {
    		this.potential = new Integer(2);
    	} else {
    		this.potential = new Integer(1);
    	}
    	
        //this.potential = new Double(po).intValue();
    }
    
    /**
     * 
     * @param assessorEvalution
     * @param internalBenchmark
     * @param externalBenchmark
     * @return
     */
    public OwnerRelations init(String assessorEvalution, String internalBenchmark, String externalBenchmark) {
        this.assessorEvalution = assessorEvalution;
        this.internalBenchmark = internalBenchmark;
        this.externalBenchmark = externalBenchmark;
        return this;
    }

    /**
     * 
     * @param ljtr
     * @param zqfk
     * @param yrhd
     * @param sftr
     * @param tdhz
     * @param tzgd
     * @param csbz
     * @param jjct
     * @return
     */
    public OwnerRelations init(int ljtr, int zqfk, int yrhd, int sftr, int tdhz, int tzgd, int csbz, int jjct) {
    	this.ljtr = ljtr;
    	this.zqfk = zqfk;
    	this.yrhd = yrhd;
    	this.sftr = sftr;
    	this.tdhz = tdhz;
    	this.tzgd = tzgd;
    	this.csbz = csbz;
    	this.jjct = jjct;
    	
    	double po = (ljtr + zqfk + yrhd + tdhz + tzgd + csbz + jjct) * 0.111111 + (sftr) * 0.222222;
        //this.potential = new Double(po).intValue();
    	
    	if(po > new Double(6.88)) {
    		this.potential = new Integer(10);
    	} else if (po > new Double(6.50)) {
    		this.potential = new Integer(9);
    	} else if (po > new Double(6.25)) {
    		this.potential = new Integer(8);
    	} else if (po > new Double(5.88)) {
    		this.potential = new Integer(7);
    	} else if (po > new Double(5.50)) {
    		this.potential = new Integer(6);
    	} else if (po > new Double(5.13)) {
    		this.potential = new Integer(5);
    	} else if (po > new Double(4.75)) {
    		this.potential = new Integer(4);
    	} else if (po > new Double(4.50)) {
    		this.potential = new Integer(3);
    	} else if (po > new Double(4.13)) {
    		this.potential = new Integer(2);
    	} else {
    		this.potential = new Integer(1);
    	}
    	
        return this;
    }

	public String getAssessorEvalution() {
		return assessorEvalution;
	}

	public void setAssessorEvalution(String assessorEvalution) {
		this.assessorEvalution = assessorEvalution;
	}

	public String getInternalBenchmark() {
		return internalBenchmark;
	}

	public void setInternalBenchmark(String internalBenchmark) {
		this.internalBenchmark = internalBenchmark;
	}

	public String getExternalBenchmark() {
		return externalBenchmark;
	}

	public void setExternalBenchmark(String externalBenchmark) {
		this.externalBenchmark = externalBenchmark;
	}

	public int getLjtr() {
		return ljtr;
	}

	public void setLjtr(int ljtr) {
		this.ljtr = ljtr;
	}

	public int getZqfk() {
		return zqfk;
	}

	public void setZqfk(int zqfk) {
		this.zqfk = zqfk;
	}

	public int getYrhd() {
		return yrhd;
	}

	public void setYrhd(int yrhd) {
		this.yrhd = yrhd;
	}

	public int getSftr() {
		return sftr;
	}

	public void setSftr(int sftr) {
		this.sftr = sftr;
	}

	public int getTdhz() {
		return tdhz;
	}

	public void setTdhz(int tdhz) {
		this.tdhz = tdhz;
	}

	public int getTzgd() {
		return tzgd;
	}

	public void setTzgd(int tzgd) {
		this.tzgd = tzgd;
	}

	public int getCsbz() {
		return csbz;
	}

	public void setCsbz(int csbz) {
		this.csbz = csbz;
	}

	public int getJjct() {
		return jjct;
	}

	public void setJjct(int jjct) {
		this.jjct = jjct;
	}

	public int getPotential() {
		return potential;
	}

	public void setPotential(int potential) {
		this.potential = potential;
	}
}
